package com.gzhryc.shared_device.common.device.dao;

import com.gzhryc.jdbc.BaseDao;
import com.gzhryc.jdbc.Conditions;
import com.gzhryc.jdbc.Query;
import com.gzhryc.shared_device.common.device.dao.db.DeviceTypeFunc;

import java.sql.SQLException;
import java.util.List;

/**
 * 客户应用对象数据访问
 * @version 2022-01-24
 */
public class DeviceTypeFuncDao extends BaseDao<DeviceTypeFunc> {

    public DeviceTypeFuncDao(String jdbcKey) {
        super(jdbcKey);
    }

    public List<String> findTypeIdByCondition(Conditions conditions) throws SQLException {
        String sql = "SELECT type_id FROM " + this.tableName;
        Query query = new Query(sql);
        query.appendSql(conditions.toSql(query.getParams(),true));

        return this.jdbcHelper.findFirstField(query,String.class);
    }
}
